# 1. 判断是否为图片类型文件
def image_file(data):
    try:
        image_data = str(data)
        data_list = image_data.rpartition(".")
        image_type = data_list[-1]
        if image_type.upper() in ["JPEG","JPG","PNG","GIF","BMP"]:
            return True
        else:
            return False
    except Exception as e:
        return False
